﻿package net.wangit.view.unit.grid;

import net.wangit.context.ActionContext;
import net.wangit.view.unit.UnitComponent;

public final class LeftNavigatorCard extends TopNavigatorCard {

	public LeftNavigatorCard(ActionContext ac, UnitComponent unit) {
		super(ac, unit);
	}

	protected void writeTabs(StringBuffer html) {
		html
				.append("<table id=\"tabs_")
				.append(uc.getId())
				.append(
						"\" width=\"1%\" height=\"100%\" cellpadding=\"0\" cellspacing=\"0\" class=\"")
				.append("CT").append("\">");
		for (int i = 0; i < groups.size(); i++) {
			Group group = (Group) groups.get(i);
			html.append("<tr><td onclick=\"_showCard('").append(uc.getId())
					.append("','").append(group.getGroupId()).append(
							"',false)\" id=\"").append(group.getGroupId())
					.append("\"><div class=\"").append(i != 0 ? "C0" : "C1")
					.append("\">").append(group.getGroupName()).append(
							"</div></td></tr>");
		}

		html.append("<tr><td class=\"").append("CS").append("\"").append(
				" height=\"100%\">&nbsp;<td></tr>");
		html.append("</table>");
	}

	protected String getCardCss() {
		return null;
	}

	protected void separateGrid(StringBuffer html) {
		html.append("</td><td class=\"").append("CG").append("\">");
	}
}
